package com.cxd.performance.enums;

import com.cxd.performance.service.IBusinessException;
import lombok.Getter;
import lombok.ToString;

/**
 * Author: Calvin
 * Date: 2019-08-30 8:40
 * Description: 系统基础异常码
 */
@Getter
@ToString
public enum  BaseCodeEnum implements IBusinessException {

    SUCCESS("0", "Success"),
    FAILED("1", "系统繁忙,请稍后再试"),
    ACCOUNT_OR_PASSOWD_WRONG("101", "账号或密码错误"),
    NO_PERMISSION("102", "没有访问该资源的权限"),
    SIGN_ERROR_WITH_EMPTY_DATA("103", "数据签名错误,存在为空的参数"),
    GET_SECRET_ERROR("104", "找不到本应用失败"),
    NO_CURRENT_USER("105", "当前没有登录的用户"),
    TOKEN_EXPIRED("106", "token过期"),
    TOKEN_ERROR("107", "token验证失败"),
    PERMISSION_ERROR("108", "没有访问该资源的权限"),
    SIGN_ERROR("109", "签名验证失败"),
    VERSION_EXPIRES("110", "数据已过期，请刷新后操作"),
    WRITE_ERROR("500", "渲染界面错误"),
    REQUEST_NULL("400", "请求数据为空或格式错误"),
    PARAMETER_INVALID("501", "参数校验失败"),
    PAGE_NULL("404", "请求页面不存在"),
    IO_ERROR("500", "流读取异常"),
    SERVICE_ERROR("500", "服务器异常"),
    REMOTE_SERVICE_NULL("404", "远程服务不存在"),
    PAGE_SIZE_MORE_THAN_1000("1001", "PageSize is too large,it must be less than 1001"),
    ENCRYPT_ERROR("1002", "加解密错误"),
    REQUEST_TOO_MANY("1003", "请求太频繁,请稍后重试"),
    ;

    private String code;
    private String msg;

    BaseCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

}
